public class Test {
    public static void main(String[] args){
        /**
         * 第二课 数据类型和运算符
         */
   /*int a = 10;

        int b;
        b = 19;
        System.out.println(b);
*/
        int a = 10;
        int c = 2147483647+a;
        System.out.println(c);
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);
    }
    public static void mainLong(String[] args) {
        /**
         * 长整型
         *      8个字节
         *         63个bit位
         *
         */
        long a = 10L;
        System.out.println(a);
        System.out.println(Long.MIN_VALUE);
        System.out.println(Long.MAX_VALUE);
    }
    public static void mainShort(String[] args) {
        short a = 10;
        System.out.println(a);
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);


        byte b = 127;//整型提升在里面的
        System.out.println(b);
        System.out.println(Byte.MIN_VALUE);
        System.out.println(Byte.MAX_VALUE);
    }
    public static void mainFloat(String[] args) {
        double d = 12.5;
        System.out.println(d);

        double a = 1.0;
        double b = 2.0;
        System.out.println(a / b);

        int c = 1;
        int e = 2;
        System.out.println(c*1.0/e);

        double num = 1.1;
        System.out.println(num * num);//1.21

        float f = 12.5f;//4个字节
        System.out.println(f);

    }
    public static void main5(String[] args) {
        char a = 'A';
        char b = '张';
        System.out.println(a);
        System.out.println(b);

        boolean flg = true;
        System.out.println(flg);
    }
    public static void main6(String[] args) {
        int a = 10;
        long b = 20;

        //int c = a + b;
        long c = a + b;
        int c2 = (int)(a + b);

        byte f = 10;
        byte f2 = 20;

        //byte f3 = f + f2;
        int f3 = f + f2;
        byte f4 = (byte)(f + f2);
    }
    public static void main7(String[] args) {
        String str = "hello";
        System.out.println(str);
        System.out.println(str.length());

        String str2 = "345";
        //int val = Integer.valueOf(str2);
        int val = Integer.parseInt(str2);
        System.out.println(val+1);

        int p = 100;
        String str3 = String.valueOf(p);
        System.out.println(str3);
        System.out.println("=======================");
        int a = 10;
        int b = 20;
        //System.out.println("a = "+a +" b = " + b);
        System.out.println("a + b = "+a+b);// a+b=1020
        System.out.println(a+b + "a + b  ");//30a+b
    }
    public static void main8(String[] args) {
        /*System.out.println(5/2);
        System.out.println((float)5/2);
        System.out.println(5/(float)2);
        System.out.println((float)(5/2));
        */
        /*System.out.println(10%3);
        System.out.println(-10%3);
        System.out.println(10%-3);
        System.out.println(-10%-3);

        System.out.println("================");
        System.out.println(11.5%2);*/

        System.out.println(10/0);
    }
    public static void main9(String[] args) {
        int a = 10;
        int b = a++;//b = a   a++
        System.out.println(b);
        System.out.println(a);
        /*int a = 1;
        a += 2;//a = a+2
        System.out.println(a);
*/

/*
        int a = 4;
        double d = 5.0;
        a += d;
        //对于 += 操作符来说  自动给你进行转换
        //a = (int)(a+d);
        System.out.println(a);
        */
    }
    public static void main10(String[] args) {
        int a = 10;
        int b = 20;

        if(!(a > b)) {
            System.out.println("Fsfas");
        }

        System.out.println("=============");
        //System.out.println(!a);
        System.out.println(!true);
        System.out.println(!false);
// 注意：在Java中 = 表示赋值，要与数学中的含义区分
// 在Java中 == 表示相等
        System.out.println(a == b); // false
        System.out.println(a != b); // true
        System.out.println(a < b); // true
        System.out.println(a > b); // false
        System.out.println(a <= b); // true
        System.out.println(a >= b); // false
    }
}